package com.jy.admin.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.jy.admin.db.dao.ClUploadDao;
import com.jy.admin.db.entity.ClUploadEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: anonymous
* Date: 2021-11-23
* Time: 15:04:10.340
*/

@Repository
public class ClUploadDaoImpl extends AbstractBaseMapper<ClUploadEntity> implements ClUploadDao {

    @Override
    public ClUploadEntity findByCode(String code) {
        Map<String,String> params = new HashMap<>();
        params.put("code",code);
        return getSqlSession().selectOne(this.getStatement("findByCode"), params);
    }

    @Override
    public List<ClUploadEntity> findListByAdminAndStatus(String adminCode, Integer status) {
        Map<String,Object> params = new HashMap<>();
        params.put("adminCode",adminCode);
        params.put("status",status);
        return getSqlSession().selectList(this.getStatement("findListByAdminAndStatus"), params);
    }

    @Override
    public List<ClUploadEntity> findListByStatus(Integer status) {
        Map<String,Integer> params = new HashMap<>();
        params.put("status",status);
        return getSqlSession().selectList(this.getStatement("findListByStatus"), params);
    }
}